Adds a new item into the cache using the specified absolute expiration data and region name.


public virtual bool Add<>(
string ,
,
DateTime ,
string
)
'Declaration
Public Overloads Overridable Function Add(Of )( _
ByVal As String, _
ByVal As , _
ByVal As Date, _
ByVal As String _
) As Boolean
'Usage
Dim instance As ObjectCache
Dim key As String
Dim value As
Dim absoluteExpiration As Date
Dim regionName As String
Dim value As Boolean
value = instance.Add(Of T)(key, value, absoluteExpiration, regionName)
public<T> boolean add(String key, T value, Class<?> classOfT, Date absoluteExpiration, String regionName)
public:
virtual bool Addgeneric<typename >
(
String^ ,
,
DateTime ,
String^
)
Parameters
- key
- Unique identifier of the cache item.
- value
- Data for the cache item.
- absoluteExpiration
- Absolute expiration date to use.
- regionName
- Optional name of a region in cache.
Type Parameters
- T
Return Value
true if the item was added successfully, false if there is an item in the cache that has the same key.